# 捕获异常
try:
    f = open('test.txt')
except IOError:
    print('File cannot be opened')